package pages;

import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.android.AndroidDriver;
import utiles.BaseAction;

public class ResultPage {
	AndroidDriver driver;
	BaseAction action;
	public ResultPage(AndroidDriver driver) {
		this.driver=driver;
		action=new BaseAction(driver);
	}
	
	
	public WebElement edit_exerciseResult() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/et_content"));
	}
	
	public WebElement btn_saveExerciseResult() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/tv_save"));
	}
	
	public void editExerciseResult(String result) throws InterruptedException {
		action.type(this.edit_exerciseResult(), result);
		action.click(this.btn_saveExerciseResult());
	}
	
	public String editExerciseResultSuccess(String result) throws InterruptedException {
		editExerciseResult(result);
		return action.getToastMsg();
	}
}
